import 'reflect-metadata';
import { provide } from 'inversify-binding-decorators';
import User from '../models/user.model';

// 先定义类
class UserService {
  async createUser(name: string, email: string): Promise<User> {
    return User.create({ name, email });
  }

  async getUserById(id: number): Promise<User | null> {
    return User.findByPk(id);
  }

  async getAllUsers(): Promise<User[]> {
    return User.findAll();
  }
}

// 再应用装饰器
// 修改为直接导出类
export default UserService;